import Vue from 'vue';
import VueRouter from 'vue-router';
import Home from '../views/Home.vue';

Vue.use(VueRouter);

const routes = [
  {
    path: '/',
    redirect: '/Login',
  },
  {
    path: '/Login',
    name: 'Login',
    component: () => import('../views/Login.vue'),
  },
  {
    path: '/Home',
    name: 'Home',
    component: Home,
    redirect: '/About',
    children: [
      {
        path: '/About',
        name: 'About',
        component: () => import('../views/About.vue'),
      },
      {
        path: '/Voice',
        name: 'Voice',
        component: () => import('../views/Voice.vue'),
      },
      {
        path: '/Result',
        name: 'Result',
        component: () => import('../views/result.vue'),
      },
    ],
  },

  // 第二套
  {
    path: '/HomeTwo',
    name: 'HomeTwo',
    component: () => import('../views/two/Home.vue'),
    redirect: '/AboutTwo',
    children: [
      {
        path: '/AboutTwo',
        name: 'AboutTwo',
        component: () => import('../views/two/About.vue'),
      },
      {
        path: '/VoiceTwo',
        name: 'VoiceTwo',
        component: () => import('../views/two/Voice.vue'),
      },
      {
        path: '/UserInfoTwo',
        name: 'UserInfoTwo',
        component: () => import('../views/two/UserInfo.vue'),
      },
      {
        path: '/ResultTwo',
        name: 'ResultTwo',
        component: () => import('../views/two/result.vue'),
      },
    ],
  },
];

const router = new VueRouter({
  routes,
});

export default router;
